Integrand size = 29, antiderivative size = 499 \[ \int \frac {x^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=\frac {2 a b d n x}{e g}-\frac {2 b^2 d n^2 x}{e g}+\frac {b^2 n^2 (d+e x)^2}{4 e^2 g}+\frac {2 b^2 d n (d+e x) \log \left (c (d+e x)^n\right )}{e^2 g}-\frac {b n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 e^2 g}-\frac {d (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2 g}+\frac {(d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2 g}-\frac {f \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 g^2}-\frac {f \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 g^2}-\frac {b f n \left (a+b \log \left (c (d+e x)^n\right )\right ) \operatorname {PolyLog}\left (2,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{g^2}-\frac {b f n \left (a+b \log \left (c (d+e x)^n\right )\right ) \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{g^2}+\frac {b^2 f n^2 \operatorname {PolyLog}\left (3,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{g^2}+\frac {b^2 f n^2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{g^2} \]
[Out]
Time = 0.50 (sec) , antiderivative size = 499, normalized size of antiderivative = 1.00, number of steps used = 21, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.414, Rules used = {2463, 2448, 2436, 2333, 2332, 2437, 2342, 2341, 2443, 2481, 2421, 6724} \[ \int \frac {x^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=-\frac {b n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 e^2 g}+\frac {(d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2 g}-\frac {d (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2 g}-\frac {b f n \operatorname {PolyLog}\left (2,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{g^2}-\frac {b f n \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{\sqrt {g} d+e \sqrt {-f}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{g^2}-\frac {f \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{d \sqrt {g}+e \sqrt {-f}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 g^2}-\frac {f \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 g^2}+\frac {2 a b d n x}{e g}+\frac {2 b^2 d n (d+e x) \log \left (c (d+e x)^n\right )}{e^2 g}+\frac {b^2 n^2 (d+e x)^2}{4 e^2 g}+\frac {b^2 f n^2 \operatorname {PolyLog}\left (3,-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{g^2}+\frac {b^2 f n^2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{\sqrt {g} d+e \sqrt {-f}}\right )}{g^2}-\frac {2 b^2 d n^2 x}{e g} \]
[In]
[Out]
Rule 2332
Rule 2333
Rule 2341
Rule 2342
Rule 2421
Rule 2436
Rule 2437
Rule 2443
Rule 2448
Rule 2463
Rule 2481
Rule 6724
Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {x \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{g}-\frac {f x \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{g \left (f+g x^2\right )}\right ) \, dx \\ & = \frac {\int x \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx}{g}-\frac {f \int \frac {x \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx}{g} \\ & = \frac {\int \left (-\frac {d \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e}+\frac {(d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e}\right ) \, dx}{g}-\frac {f \int \left (-\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 \sqrt {g} \left (\sqrt {-f}-\sqrt {g} x\right )}+\frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 \sqrt {g} \left (\sqrt {-f}+\sqrt {g} x\right )}\right ) \, dx}{g} \\ & = \frac {f \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\sqrt {-f}-\sqrt {g} x} \, dx}{2 g^{3/2}}-\frac {f \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{\sqrt {-f}+\sqrt {g} x} \, dx}{2 g^{3/2}}+\frac {\int (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx}{e g}-\frac {d \int \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx}{e g} \\ & = -\frac {f \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 g^2}-\frac {f \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 g^2}+\frac {\text {Subst}\left (\int x \left (a+b \log \left (c x^n\right )\right )^2 \, dx,x,d+e x\right )}{e^2 g}-\frac {d \text {Subst}\left (\int \left (a+b \log \left (c x^n\right )\right )^2 \, dx,x,d+e x\right )}{e^2 g}+\frac {(b e f n) \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{d+e x} \, dx}{g^2}+\frac {(b e f n) \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{d+e x} \, dx}{g^2} \\ & = -\frac {d (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2 g}+\frac {(d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2 g}-\frac {f \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 g^2}-\frac {f \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 g^2}+\frac {(b f n) \text {Subst}\left (\int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (\frac {e \left (\frac {e \sqrt {-f}+d \sqrt {g}}{e}-\frac {\sqrt {g} x}{e}\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{g^2}+\frac {(b f n) \text {Subst}\left (\int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (\frac {e \left (\frac {e \sqrt {-f}-d \sqrt {g}}{e}+\frac {\sqrt {g} x}{e}\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{g^2}-\frac {(b n) \text {Subst}\left (\int x \left (a+b \log \left (c x^n\right )\right ) \, dx,x,d+e x\right )}{e^2 g}+\frac {(2 b d n) \text {Subst}\left (\int \left (a+b \log \left (c x^n\right )\right ) \, dx,x,d+e x\right )}{e^2 g} \\ & = \frac {2 a b d n x}{e g}+\frac {b^2 n^2 (d+e x)^2}{4 e^2 g}-\frac {b n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 e^2 g}-\frac {d (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2 g}+\frac {(d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2 g}-\frac {f \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 g^2}-\frac {f \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 g^2}-\frac {b f n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{g^2}-\frac {b f n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{g^2}+\frac {\left (2 b^2 d n\right ) \text {Subst}\left (\int \log \left (c x^n\right ) \, dx,x,d+e x\right )}{e^2 g}+\frac {\left (b^2 f n^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (-\frac {\sqrt {g} x}{e \sqrt {-f}-d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{g^2}+\frac {\left (b^2 f n^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (\frac {\sqrt {g} x}{e \sqrt {-f}+d \sqrt {g}}\right )}{x} \, dx,x,d+e x\right )}{g^2} \\ & = \frac {2 a b d n x}{e g}-\frac {2 b^2 d n^2 x}{e g}+\frac {b^2 n^2 (d+e x)^2}{4 e^2 g}+\frac {2 b^2 d n (d+e x) \log \left (c (d+e x)^n\right )}{e^2 g}-\frac {b n (d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )}{2 e^2 g}-\frac {d (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e^2 g}+\frac {(d+e x)^2 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{2 e^2 g}-\frac {f \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}-\sqrt {g} x\right )}{e \sqrt {-f}+d \sqrt {g}}\right )}{2 g^2}-\frac {f \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e \left (\sqrt {-f}+\sqrt {g} x\right )}{e \sqrt {-f}-d \sqrt {g}}\right )}{2 g^2}-\frac {b f n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{g^2}-\frac {b f n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{g^2}+\frac {b^2 f n^2 \text {Li}_3\left (-\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}-d \sqrt {g}}\right )}{g^2}+\frac {b^2 f n^2 \text {Li}_3\left (\frac {\sqrt {g} (d+e x)}{e \sqrt {-f}+d \sqrt {g}}\right )}{g^2} \\ \end{align*}
Result contains complex when optimal does not.
Time = 0.49 (sec) , antiderivative size = 637, normalized size of antiderivative = 1.28 \[ \int \frac {x^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=\frac {2 e^2 g x^2 \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2-2 e^2 f \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (f+g x^2\right )+2 b n \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right ) \left (e g x (2 d-e x)-2 g \left (d^2-e^2 x^2\right ) \log (d+e x)-2 e^2 f \left (\log (d+e x) \log \left (1-\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )\right )-2 e^2 f \left (\log (d+e x) \log \left (1-\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )+\operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )\right )\right )-b^2 n^2 \left (g \left (e x (6 d-e x)+\left (-6 d^2-4 d e x+2 e^2 x^2\right ) \log (d+e x)+2 \left (d^2-e^2 x^2\right ) \log ^2(d+e x)\right )+2 e^2 f \left (\log ^2(d+e x) \log \left (1-\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )+2 \log (d+e x) \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )-2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{-i e \sqrt {f}+d \sqrt {g}}\right )\right )+2 e^2 f \left (\log ^2(d+e x) \log \left (1-\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )+2 \log (d+e x) \operatorname {PolyLog}\left (2,\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )-2 \operatorname {PolyLog}\left (3,\frac {\sqrt {g} (d+e x)}{i e \sqrt {f}+d \sqrt {g}}\right )\right )\right )}{4 e^2 g^2} \]
[In]
[Out]
\[\int \frac {x^{3} {\left (a +b \ln \left (c \left (e x +d \right )^{n}\right )\right )}^{2}}{g \,x^{2}+f}d x\]
[In]
[Out]
\[ \int \frac {x^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2} x^{3}}{g x^{2} + f} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {x^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=\text {Timed out} \]
[In]
[Out]
\[ \int \frac {x^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2} x^{3}}{g x^{2} + f} \,d x } \]
[In]
[Out]
\[ \int \frac {x^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=\int { \frac {{\left (b \log \left ({\left (e x + d\right )}^{n} c\right ) + a\right )}^{2} x^{3}}{g x^{2} + f} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {x^3 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x^2} \, dx=\int \frac {x^3\,{\left (a+b\,\ln \left (c\,{\left (d+e\,x\right )}^n\right )\right )}^2}{g\,x^2+f} \,d x \]
[In]
[Out]